<?php

class TextareaApp extends BackendApp {

    function __construct() {
        $this->TextareaApp();
    }

    function TextareaApp() {
        parent::BackendApp();

        $this->_textarea_mod = & m('textarea');
    }

    function index() {
        $model_setting = & m('textarea');
        $setting = $model_setting->get('1=1'); //载入系统设置数据
        if (!IS_POST) {
            $this->import_resource(array('script' => 'jquery.plugins/jquery.validate.js,change_upload.js'));
            $template_name = $this->_get_template_name();
            $style_name = $this->_get_style_name();
            $this->assign('build_editor1', $this->_build_editor(array(
                'name' => 'resign',
                'content_css' => SITE_URL . "/themes/mall/{$template_name}2/styles/{$style_name}2/css/ecmall.css"
            )));

            $this->assign('textarea', $setting);
            $this->display('textarea.html');
        } else {
            $data['resign'] = $_POST['resign'];#是否开启自动注册
            $data['wish'] = $_POST['wish'];
            $data['member'] = $_POST['member'];
            $data['address'] = $_POST['address'];
            $data['our'] = $_POST['our'];
            $data['customs'] = $_POST['customs'];
            $data['price'] = $_POST['price'];
            $data['know'] = $_POST['know'];
            $model_setting->edit($setting['id'],$data);
            $this->show_message('edit_setting_account_successed');
        }
    }
}

?>
